﻿using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Collections.Generic;
using System.Text;
using System.IO;
using TwitterWrapper;

namespace TwitterBEIS_SL3_WebRole
{
    [ServiceContract(Namespace = "")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    [ServiceBehavior(AddressFilterMode=AddressFilterMode.Any)]
    public class TwitterProxy
    {

        [OperationContract]
        public Stream FriendsTimeLine(string name, string password)
        {
            TwitterStatus status = new TwitterStatus(name, password);
            return status.FriendsTimeline();
        }

        [OperationContract]
        public Stream VerifyCredentials(string name,string password)
        {
            TwitterAccount account = new TwitterAccount(name, password);
            return account.VerifyCredentials();
        }

        [OperationContract]
        public Stream UserTimeline(string name, string password,string id)
        {
            TwitterStatus status = new TwitterStatus(name, password);
            return status.UserTimeline(id);
        }

        [OperationContract]
        public Stream Update(string name,string password,string update)
        {
            TwitterStatus status = new TwitterStatus(name, password);
            return status.Update(update);
        }

        [OperationContract]
        public Stream Replies(string name, string password)
        {
            TwitterStatus status = new TwitterStatus(name, password);
            return status.Replies();
        }

        [OperationContract]
        public Stream DirectMessages(string name, string password)
        {
            TwitterDMessage dm = new TwitterDMessage(name, password);
            return dm.DirectMessages();
        }

        [OperationContract]
        public Stream NewDM(string name, string password, string user, string text)
        {
            TwitterDMessage dm = new TwitterDMessage(name, password);
            return dm.New(user, text);
        }
        [OperationContract]
        public Stream Friends(string name, string password,string id)
        {
            TwitterUser user = new TwitterUser(name, password);
            return user.Friends(id);
        }
        // Add more operations here and mark them with [OperationContract]
    }
}
